### Download and load data

library(lme4)
library(texreg)


# Main models (Table 3)
m1 <-lmer(wgi ~ executive_share + executive_share:length   + growth + log(gdpcap) + trade_perc + infl + six_months_minority + six_months_first_time + (1 | code) + (1 | time), data=final4)
summary(m1)


m2 <-lmer(bci ~  executive_share + executive_share:length  + growth + log(gdpcap) + trade_perc + infl + wgi + six_months_minority + six_months_first_time + (1 | code) + (1 | time), data=final4)
summary(m2)

screenreg(list(m1, m2), custom.model.names=c("WGI", "BCI"), digits = 3, stars = c(0.1,0.05,0.01))


# Main models (Table 4)

m1a <-lmer(wb_ge ~ executive_share + executive_share:length  + growth + log(gdpcap) + trade_perc + infl + six_months_minority + six_months_first_time + (1 | code) + (1 | time), data=final4)
summary(m1a)

m1b <-lmer(wb_rq ~ executive_share + executive_share:length  + growth + log(gdpcap) + trade_perc + infl + six_months_minority + six_months_first_time + (1 | code) + (1 | time), data=final4)
summary(m1b)

m1c <-lmer(wb_cc ~ executive_share + executive_share:length  + growth + log(gdpcap) + trade_perc + infl + six_months_minority + six_months_first_time+ (1 | code) + (1 | time), data=final4)
summary(m1c)

m1d <-lmer(wb_rl ~ executive_share + executive_share:length  + growth + log(gdpcap) + trade_perc + infl + six_months_minority + six_months_first_time + (1 | code) + (1 | time), data=final4)
summary(m1d)

m1e <-lmer(wb_ps ~ executive_share + executive_share:length  + growth + log(gdpcap) + trade_perc + infl + six_months_minority + six_months_first_time + (1 | code) + (1 | time), data=final4)
summary(m1e)

m1f <-lmer(wb_va ~ executive_share + executive_share:length  + growth + log(gdpcap) + trade_perc + infl + six_months_minority + six_months_first_time + (1 | code) + (1 | time), data=final4)
summary(m1f)

m1g <-lmer(wgi ~ executive_share + executive_share:length  + growth + log(gdpcap) + trade_perc + infl + six_months_minority + six_months_first_time + (1 | code) + (1 | time), data=final4)
summary(m1g)

screenreg(list(m1a,m1b,m1c,m1d,m1e,m1f), stars = c(0.01,0.05,0.1), digits = 3)


# Models with the executive dummies (Appendix Table A1)
m1_exec_dummy <-lmer(wgi ~ executive_share_dummy + executive_share_dummy:length  + growth + log(gdpcap) + trade_perc + infl + six_months_minority + six_months_first_time + (1 | code) + (1 | time), data=final4)
summary(m1_exec_dummy)


m2_exec_dummy <-lmer(bci ~  executive_share_dummy + executive_share_dummy:length  + growth + log(gdpcap) + trade_perc + infl + wgi + six_months_minority + six_months_first_time + (1 | code) + (1 | time), data=final4)
summary(m2_exec_dummy)

screenreg(list(m1_exec_dummy, m2_exec_dummy), custom.model.names=c("WGI", "BCI"), stars = c(0.01,0.05,0.1), digits = 3)


# Models with the weighted variables (Appendix Table A2)
m1_weights <-lmer(wgi ~ executive_share + executive_share:length  + growth + log(gdpcap) + trade_perc + infl + minority_weight + first_time_weight + (1 | code) + (1 | time), data=final4)
summary(m1_weights)


m2_weights <-lmer(bci ~  executive_share + executive_share:length  + growth + log(gdpcap) + trade_perc + infl + wgi + minority_weight + first_time_weight + (1 | code) + (1 | time), data=final4)
summary(m2_weights)

screenreg(list(m1_weights, m2_weights), custom.model.names=c("WGI", "BCI"), stars = c(0.01,0.05,0.1), digits = 3)




